import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import LoginPage from '../pages/login'
import RegisterPage from '../pages/register'
import ClassifyPage from '../pages/classify'
import UserPage from '../pages/user'
import ShopCartPage from '../pages/shopCart'
import HomePage from '../pages/home'

import ProDetailPage from '../pages/proDetails'
import DetailSubPage from '../pages/subPages/details'
import EvaluateSubPage from '../pages/subPages/evaluate'


export default new VueRouter({
    routes: [{
        path: '/',
        redirect: '/home',
    }, {
        path: '/home',
        name: 'home',
        component: HomePage,
    }, {
        path: '/login',
        name: 'login',
        component: LoginPage,
    }, {
        path: '/register',
        name: 'register',
        component: RegisterPage,
    }, {
        path: '/classify',
        name: 'classify',
        component: ClassifyPage,
    }, {
        path: '/user',
        name: 'user',
        component: UserPage,
    }, {
        path: '/shopcart',
        name: 'shopcart',
        component: ShopCartPage,
    }, {
        path: '/detail',
        name: 'detail',
        redirect: '/detail/subDetail',
        component: ProDetailPage,
        children: [{
            path: '/detail/subDetail',
            name: 'subdetai',
            component: DetailSubPage,
        }, {
            path: '/detail/subEvaluate',
            name: 'subevaluate',
            component: EvaluateSubPage,
        }]
    }]
})